package com.ye.personnel.common.exception;

import com.ye.personnel.common.response.ErrorCode;
import lombok.Data;

/**
 * 自定义异常
 *
 * @author ye
 * @Description
 * @create 2021-09-01 16:19
 */
@Data
public class CustomerException extends RuntimeException {

    private String msg;
    private int code;

    public CustomerException(String msg) {
        super(msg);
        this.code = ErrorCode.INTERNAL_SERVER_ERROR;
        this.msg = msg;
    }

    public CustomerException(String msg, int code) {
    super(msg);
    this.msg = msg;
    this.code = code;
    }

    public CustomerException(String msg, Throwable e) {
        super(msg, e);
        this.code = ErrorCode.INTERNAL_SERVER_ERROR;
        this.msg = msg;
    }

    public CustomerException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
